//
// Created by wkm on 2024-03-31.
//

#ifndef CHIPBUS_MASTER_DIRECT_H
#define CHIPBUS_MASTER_DIRECT_H


#include "systemc.h"
#include "direct_if.h"

SC_MODULE(master_direct) {
    // ports
    sc_in_clk clock;
    sc_port<direct_if> bus_port;

    SC_HAS_PROCESS(master_direct);

    // constructor
    master_direct(sc_module_name name_, unsigned int address, int timeout, bool verbose = true)
            : sc_module(name_), m_address(address), m_timeout(timeout), m_verbose(verbose) {
        // process declaration
        SC_THREAD(main_action);
    }

    // process
    void main_action();

private:
    unsigned int m_address;
    int m_timeout;
    bool m_verbose;

};

#endif //CHIPBUS_MASTER_DIRECT_H
